package day15;

import java.util.Scanner;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2023/03/21  20:31
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int num = scanner.nextInt();
            int counts = count(num);
            System.out.println(counts);
        }
    }

    private static int count(int num) {
        int n = 0;
        String str = Integer.toBinaryString(num);
        char[] ch = str.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if(ch[i] == '1'){
                n++;
            }
        }
        return n;
    }
}
